package com.jkl.untils;

import java.math.BigDecimal;

/**
 * @author zjj
 * @date  2019/9/18 15:15
 * @Description  ${描述一个类的相关信息}
 */public class GetIntUtil {
    //四舍五入把double转化int整型，0.5进一，小于0.5不进一
    public static int getInt(double number){
        BigDecimal bd=new BigDecimal(number).setScale(0, BigDecimal.ROUND_HALF_UP);
        return Integer.parseInt(bd.toString());
    }
}
